Return a new RDD by applying a function to each element of this RDD.

27

rdd = sc.parallelize(["b", "b", "c"])
sorted(rdd.map(lambda x: (x, 1)).collect())
# [('a', 1), ('b', 1), ('c', 1)]

Comments

Submit
0 Comments